#include <stdio.h>
#include <stdlib.h>

struct list 
{
  int data;
  struct list * next;
};

/*@*/
struct list * search (struct list* head, int data)
{
  struct list * p;
  
  p = head;
  while (p != NULL && (p->data != data))
  {
    p = p->next;
  }
  return p;
}
/*@*/

/*@*/
int main()
{
  struct list * head;
  struct list * test;
  struct list * p;
  struct list * q;
  int i;
  
  i = 0;
  head = malloc (4);
  head->next = NULL;
  head->data = -1;
  p=head;
  q=head;
  while (i<100000)
  {
    p = malloc (4);
    p->data = i;
    print (p->data);
    p->next = NULL;
    q->next = p;
    q = p;
    i = i + 1;
  }
  
  p = head;
  p = search (head, 5);
  print (p->data);
  return 0;
}
/*@*/
	

